package com.pj.lib.auraServer.app.listeners;

import com.pj.lib.aura.utils.AuraTypeModel;
import com.pj.lib.auraServer.components.connection.ClientThread;

/**
 * The listener for checking if aura type is going to change (not yet changed)
 * @author Pawel Janeczek
 */
public interface OnAuraTypeChange {
	/**
	 * Fired when adding new aura type
	 * @param ct What client thread fired this event
	 * @param auraTypes Array of aura types to add
	 */
	public void addAuraTypes(ClientThread ct, AuraTypeModel[] auraTypes );
	
	/**
	 * Fired when updating aura type
	 * @param ct What client thread fired this event
	 * @param auraType Model which has values to update (all aura type parameters are changed instead of code)
	 * @param code Specifies what aura type to change
	 */
	public void updateAuraType(ClientThread ct, AuraTypeModel auraType, String code);
	
	/**
	 * Fired when deleting aura type
	 * @param ct What client thread fired this event
	 * @param code Specifies what aura type to delete
	 * @param replacementCode Specifies to what aura type change existing aura type references (user can using aura which we are deleting)
	 */
	public void deleteAuraType(ClientThread ct, String code, String replacementCode);

	/**
	 * Fires when some client want to get aura types
	 * @param ct What client thread fired this event
	 * @param code Specifies what aura type to get - if null all aura types will be send
	 */
	public void getAuraType(ClientThread ct, String code);
}
